package com.richfit.cuba.modular.controller;

import java.math.BigDecimal;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.richfit.cuba.modular.AbsScanService;
import com.richfit.cuba.modular.entity.BcDepotBorrowYearPlan;
import com.richfit.cuba.modular.lsms.entity.SafeReportData;
import com.richfit.cuba.modular.service.IBcDepotBorrowYearPlanService;

@Service
public class BcDepotBorrowYearPlanHandleService  extends AbsScanService<BcDepotBorrowYearPlan>  {

	@Autowired
	public BcDepotBorrowYearPlanHandleService(IBcDepotBorrowYearPlanService service) {
		super(service);
	}

	@Override
	public SafeReportData setBussinuessData(BcDepotBorrowYearPlan obj, SafeReportData detailObj) {
		detailObj.setOilId(obj.getOilId());
		if(obj.getQuantity() != null) {
			detailObj.setAbnomalValue(BigDecimal.valueOf(obj.getQuantity()));
		}
		detailObj.setOrganization(obj.getOrgName());

		if(obj.getMonth() != null) {
			detailObj.setCreateDate(obj.getMonth());
		}
		return detailObj;
	}

}
